package com.yike.order.convert;

import com.yike.order.entity.OrderDetail;
import com.yike.order.param.AddOrderDetailParam;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface OrderDetailConvert {

    OrderDetailConvert INSTANCE = Mappers.getMapper(OrderDetailConvert.class);

    List<OrderDetail> convert(List<AddOrderDetailParam> orderDetailParams);

    @Mapping(source = "price", target = "sellPrice")
    OrderDetail convert(AddOrderDetailParam orderDetailParam);

}
